package com.study.service.impl;

import com.study.bean.query.RecordQuery;
import com.study.bean.vo.RecordVo;
import com.study.dao.RecordDao;
import com.study.dao.impl.RecordDaoImpl;
import com.study.service.RecordService;
import com.study.util.PageInfo;

import java.util.List;

public class RecordServiceImpl implements RecordService {
    private RecordDao recordDao = new RecordDaoImpl();

    @Override
    public PageInfo selectByPage(RecordQuery recordQuery) {
        List<RecordVo> list = recordDao.selectByPage(recordQuery);
        //现在要搜索的是符合条件的总的数量
        int totalCount = recordDao.selectTotalCount(recordQuery);

        return PageInfo.ok(totalCount, list);
    }

    @Override
    public List<RecordVo> selectAll() {
        return recordDao.selectAll();
    }
}
